import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/ApplicationView.vue'
import LoginView from "@/views/LoginView";
import ProjectDetail from "@/views/ProjectDetail";

Vue.use(VueRouter)
const router = new VueRouter({
  routes: [
    {
      path: '/',
      name: 'login',
      component: () => import('../views/LoginView')
    },
    {
      path: '/application',
      name: 'application',
      component: () => import('../views/ApplicationView'),
      children: [
        {
          path: '',
          redirect: 'home'
        },
        {
          path: 'home',
          name: 'home',
          component: () => import('../views/HomeView'),
        },
        {
          path: 'talk',
          name: 'talk',
          component: () => import('../views/Talk.vue')
        },
        {
         path: 'order_detail',
         name: 'order_detail',
         component: () => import('../views/OrderDetailView')
        },
        {
          path: 'prepare',
          name: 'prepare',
          component: () => import('../views/PrepareView')
        },
        {
          path: 'my_info',
          name: 'my_info',
          component: () => import('../views/MyInfoView')
        },
      ]
    },
    {
      path:'/all_order',
      name: 'all_order',
      component: () => import('../views/AllOrdersView')
    },
    {
      path: '/project_detail',
      name: 'project_detail',
      component: () => import('../views/ProjectDetail')
    },
    {
      path:'/discuss_detail',
      name:'discuss_detail',
      component: () => import('../views/DiscussDetail')
    }
  ]
})
// 屏蔽重复路由警告
const VueRouterPush = router.push
router.push = function push(to){
	undefined
	return VueRouterPush.call(this, to).catch(err => err)
}

export default router
